<template>
	<view>
		<u-divider text="推荐产品"></u-divider>
	<!-- 	 <u-scroll-list indicatorColor="#fff0f0" indicatorActiveColor="#f56c6c">
		       <view class="u-flex u-row-left">
				  
			   </view>
		</u-scroll-list> -->
		<view style="display: flex;flex-wrap: wrap;justify-content: space-between;">
			<view v-for="(item, index) in list" :key="index" class="item">
			<view><product :info="item"/>	</view>			
			</view>
		</view>
	</view>
</template>

<script>
	import product from '@/components/product.vue'
	import {
		getStoreProductListAll,
	} from '@/api/storeProduct.js'
	export default {
		name:"recommend",
		components:{product},
		data() {
			return {
				list:[]
			};
		},
		mounted(){
			this.getList()
		},
		computed:{
			
		},
		methods:{
			getList(){
				getStoreProductListAll({isRecommend:1}).then(res=>{
					this.list=res.data
				})
			},
			sliceArray(array, size) {
			    var result = [];
			    for (var x = 0; x < Math.ceil(array.length / size); x++) {
			        var start = x * size;
			        var end = start + size;
			        result.push(array.slice(start, end));
			    }
			    return result;
			},
			
		}
	}
</script>

<style scoped lang="scss">
.item{
	width: 340rpx;
}
</style>
